package fr.lip6.move.care;

import fr.lip6.move.care.CareGen;
import fr.lip6.move.care.CompileResult;
import org.eclipse.xtend2.lib.StringConcatenation;
import sdmakerz_v1.coresyntax.generator.interfaces.IContext;
import sdmakerz_v1.coresyntax.sDMakerV1.Actor;

@SuppressWarnings("all")
public class CareActorGen {
  private CareGen mainGenerator;
  
  public CareActorGen(final CareGen mainGenerator) {
    this.mainGenerator = mainGenerator;
  }
  
  public CompileResult compile(final IContext context, final Actor actor) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("                                  ");
    _builder.newLine();
    _builder.append("Actor ");
    String _name = actor.getName();
    _builder.append(_name, "");
    _builder.append(" = new Actor(\"");
    String _name_1 = actor.getName();
    _builder.append(_name_1, "");
    _builder.append("\", actorClass);   ");
    _builder.newLineIfNotEmpty();
    _builder.append("actors.add(");
    String _name_2 = actor.getName();
    _builder.append(_name_2, "");
    _builder.append(");                                                 ");
    _builder.newLineIfNotEmpty();
    CharSequence charSequenceResult = _builder;
    String _name_3 = actor.getName();
    CompileResult _compileResult = new CompileResult(charSequenceResult, _name_3, 
      false);
    return _compileResult;
  }
}
